<template>
  <div class="item">
    <play-item
      v-for="item of play"
      :key="item.id"
      :item="item"
    ></play-item>
    
  <top-item
  v-for="item of top"
      :key="item._id"
      :item="item"
  ></top-item>
  
  </div>
</template>

<script>
import PlayItem from "./components/PlayItem.vue";
import TopItem from "./components/TopItem.vue";
export default {
  data() {
    return {
      play: [],
      top: [],
      
    };
  },
  components: {
    PlayItem,
    TopItem
  },
  mounted() {
    this.$http("http://47.108.197.28:3000/top/playlist").then((res) => {
      // console.log(res.data.playlists);
      this.play = res.data.playlists;
    });
    this.$http("http://47.108.197.28:4000/api/movie/top250").then((res) => {
      // console.log(res.data.res);
      this.top = res.data.res;
    });
  },

};
</script>

<style scoped>
.item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding-bottom: 15px;
}
</style>
